const publicStr = 'views/system/account/config/dialog.'
export default (t: (arg0: string) => any) => [
  {
    prop: 'username',
    label: '用户名',
    rules: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
    fct: {
      placeholder: '请输入用户名',
      type: 'input',
      model: 'username',
    },
  },
  {
    prop: 'roleName',
    label: '角色名',
    rules: [{ required: true, message: '请输入角色名', trigger: 'blur' }],
    fct: {
      placeholder: '请输入角色名',
      type: 'input',
      model: 'roleName',
    },
  },
  {
    prop: 'deptName',
    label: '所属部门',
    rules: [{ required: true, message: '请输入所属部门', trigger: 'blur' }],
    fct: {
      placeholder: '请输入所属部门',
      type: 'input',
      model: 'deptName',
    },
  },
  {
    prop: 'mobile',
    label: '手机号',
    rules: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
    fct: {
      placeholder: '请输入手机号',
      type: 'input',
      model: 'mobile',
    },
  },
  {
    prop: 'status',
    label: '状态',
    rules: [{
      required: true, validator: (rule: any, value: any, callback: any) => {
        if (value === false) {
          callback(new Error(t(`${publicStr}statusTips`)))
        } else {
          callback()
        }
      }, trigger: 'change'
    }],
    fct: {
      type: 'switch',
      model: 'status',
      activeText: t(`${publicStr}open`),
      inactiveText: t(`${publicStr}disable`),
      inlinePrompt: true
    },
  },
  {
    prop: 'createdAt',
    label: '创建时间',
    rules: [{ required: true, message: '请选择创建时间', trigger: 'change' }],
    fct: {
      placeholder: '请选择创建时间',
      type: 'datetime',
      model: 'createdAt',
    },
  },
  {
    prop: 'updatedAt',
    label: '更新时间',
    rules: [{ required: true, message: '请选择更新时间', trigger: 'change' }],
    fct: {
      placeholder: '请选择更新时间',
      type: 'datetime',
      model: 'updatedAt',
    },
  },
  {
    type: 'langs',
    path: 'views/system/account/config/dialog'
  }
]